package com.qingke.exe2;

import java.text.SimpleDateFormat;
import java.util.Date;

public class PrintTime {

	int n = 0;
	
	public static void main(String[] args) {
		ShowTime[] times = new ShowTime[10];
		PrintTime p = new PrintTime();
		for (int i = 0; i < times.length; i++) {
			times[i] = new ShowTime(p);
			times[i].setName("Thread" + i);
			times[i].start();
		}
	}

}

class ShowTime extends Thread {
	
	PrintTime p;
	
	public ShowTime(PrintTime p) {
		this.p = p;
	}
	
	 public void run() {
		 p.n = p.n + 100;
		 System.out.println(Thread.currentThread().getName() + ", " + p.n);
	 }
}
